package com.wechat.back.controller;

import com.wechat.back.pojo.OperationLog;
import com.wechat.back.pojo.tools.PageBean;
import com.wechat.back.pojo.tools.Result;
import com.wechat.back.service.OperationLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/log")
public class LogController {
    @Autowired
    private OperationLogService logService;
    @GetMapping("/list")
    public Result<PageBean<OperationLog>> list(
            Integer pageNum,
            Integer pageSize,
            @RequestParam(required = false) String optModule,
            @RequestParam(required = false) String optType,
            @RequestParam(required = false) String nickname,
            @RequestParam(required = false) String requestMethod
    ) {
        PageBean<OperationLog> pb =  logService.list(pageNum,pageSize,optModule,optType,nickname,requestMethod);
        return Result.success(pb);
    }

}
